<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->char('name',40);
            $table->char('org_root',3)->nullable()->comment('顶级机构');
            $table->char('org_code',11)->nullable()->comment('每2位一个级别，最多4个级别');
            $table->char('mobile', 11)->unique();
            $table->unsignedTinyInteger("gender")->default(0)->comment("性别: 0未知 1男 2女");
            $table->unsignedTinyInteger('is_manager')->default(0)->comment("是否是负责人");
            $table->unsignedTinyInteger('status')->default(0)->comment("状态: 1 正常 2 休假 3 离职");
            $table->char('role', 10)->default('')->comment("岗位");
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `users` comment '贷款经理表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
};
